package com.evil.kingdom.pojo.dto.alive;

import com.evil.kingdom.pojo.entity.action.Warfare;
import jakarta.validation.constraints.NotEmpty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;

/**
 * 长连接-出征到达
 *
 * @author liyang
 * @date 2024-06-01 18:08
 */
@Setter
@Getter
public class AliveWarfareAccess implements AliveMessageData, Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 出征名称
     */
    @NotEmpty(message = "出征名称不能为空")
    private String name;

    /**
     * 出征路段名称
     */
    @NotEmpty(message = "出征路段名称不能为空")
    private String warfareName;

    public AliveWarfareAccess() {
    }

    public AliveWarfareAccess(Warfare warfare) {
        this.name = warfare.getName();
        this.warfareName = warfare.getWarfareName();
    }
}
